package net.hn.hnms.biz.mine.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 智呈物联 pan'sx
 * 2022/11/15 14:18
 * 1.0 version
 */
@Entity
@Table(name = "alarm_message_log", schema = "public", catalog = "huaneng-smart-mine")
@ApiModel("报警推送消息记录")
@Data
public class AlarmMessageLog {
        @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "custom-id")
    @GenericGenerator(name = "custom-id", strategy = "net.hn.hnms.biz.common.jpa.utils.CustomIDGenerator")
    private  Long id;
    @ApiModelProperty("报警类型")
    private String alarmType;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "Asia/Shanghai"
    )
    @ApiModelProperty("报警时间 yyyy-MM-dd HH:mm:ss，不传默认系统时间")
    private Date time = new Date();

    @ApiModelProperty("报警内容")
    @Length(max = 1500,message = "报警内容不能超出1500的长度")
    private String area;

    @Column(columnDefinition="text")
    @ApiModelProperty(value = "接收人,后端赋值",hidden = true)
    private String toUsers;

    @Column(columnDefinition="text")
    @ApiModelProperty(value = "响应结果，后端维护")
    private String weChartResponse;

    @ApiModelProperty("监测器类型 安全监控才有 甲烷或一氧化碳")
    @Transient
    private String sensorType="";

    @ApiModelProperty("报警等级 安全监控才有 蓝色预警、黄色预警、橙色预警、红色预警")
    @Transient
    private String alarmLevel="";
}
